<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- www.baidu.com/index.html -->

  <h2>父级页面</h2>

  <iframe src="http://127.0.0.1:5500/domain/child.html" frameborder="0"></iframe>

  <script>
    document.domain = 'baidu.com'

    var user = 'admin'
  </script>

</body>
</html>